package Year21_Month10.day1012;

import java.io.IOException;
import java.util.Scanner;

public class TestException {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        while(true) {
            System.out.println("请输入用户名：");
            String name = sc.next();
            System.out.println("请输入密码：");
            String key = sc.next();
            if (!name.equals("1008611")) {
                throw new IOException("输入用户名异常");
            }else if (!key.equals("xue123")) {
                throw new IOException("输入密码异常");
            }else {
                System.out.println("欢迎您登录！");
                break;
            }
        }
    }
}
